
#include <avr/io.h>
#include <inttypes.h>
#include <util/delay.h>
#include <inttypes.h>
#include <avr/pgmspace.h>
#include <avr/interrupt.h>
#include <avr/sleep.h>

#include "usart.h"


void interrupt_init(void){
   
    GICR = 0;
    //GICR &= 0xDF;
    //MCUCSR |= 1<<ISC00;
    //GIFR |= 1<<INTF0;
    GICR |= 0x40;
    SREG |= 0x80;
}




/*****************************************************************************
Name:          SIGNAL
Description:    USART RX interrupt
            INTERRUPT can be interrupted
            SIGNAL can't be interrupted
            (USART_RXC_vect)      
            (SIG_UART_RECV)
Parameters:    SIG_UART_RECV
Returns:        SIGNAL
*****************************************************************************/
ISR (USART_RXC_vect)
{ 
  data = UDR;
  
  USART_Transmit(data);
	
	

}
void delay(int msec){

	int i=0;
		for(i=0;i<msec;i++) _delay_ms(1);
	
}

int main(void){

	interrupt_init();
	USART_init();
	
	
	
	unsigned char i=0;
	//USART_Transmit(0x01);
	while(1){
	//	_delay_ms(200);
		//USART_Transmit(0x01);
		//delay(1000);
	}

}